﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using VitaminK.Wcf;
using VitaminK.Wcf.Behaviors.Custom;

namespace Secure.Service
{
    public class GatewayServiceDefinition : ServiceDefinition<GatewayService>
    {
        public override void Load()
        {
            AddBaseAddress(HostAddress().OnPort(10001).WithScheme(Scheme.Http));
            AddEndpoint<IGatewayService>()
                .WithBasicHttpBinding()
                .WithBindingNamespace("http://illogikal.net/binding/2009/01")
                .WithBindingName("Basic")
                .WithTransportCredentials(HttpClientCredentialType.Windows)
                .WithAddress("");
            HostTimeouts.CloseTimeout = 5;
            AddBehavior(new MetadataBehavior());
        }

        public override string ServiceName
        {
            get { return "SecureGateway Service"; }
        }
    }
}
